
#ifndef _USER_CAN_H_
#define _USER_CAN_H_

#include "interface.h"


typedef enum { FALSE = 0, TRUE } BOOL;



#define CAN_APP_SEND_4BA			0x4BA
#define CAN_NM_SEND_665 			0x665	//update Nm Id



typedef struct _CAN_MSG_INFO 
{
	uint8_t msgBoxIndex;		//for debug
	uint32_t Id;				//ID
	uint8_t Dlc;				//Data length
	uint8_t Msgbuff[8];			//Data
} CAN_MSG_INFO;

#define CAN_RX_BUFF_COUNT	32

typedef struct _CAN_INTERFACE_INFO 
{
	BOOL canAPPSendEnable;

	BOOL canAPPRecEnable;
	BOOL canNMRecEnable;
	
	uint8_t canSendIndex;
	
	CAN_MSG_INFO canRXBuff[CAN_RX_BUFF_COUNT];
	uint16_t canRXHx;
	uint16_t canRXLx;
} CAN_INTERFACE_INFO;

extern CAN_INTERFACE_INFO 	canInterfaceInfo;




void CAN_Send(uint32_t can_tx_id, uint8_t tx_len, uint8_t* tx_data,uint8_t IDE);



void User_CAN_Init(void);


#endif






